home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10816 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: newsbf02.news.aol.com!not-for-mail
  2. From: jwpirie@aol.com (JWPirie)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: private base class vs. private member object
  5. Date: 11 Mar 1996 08:23:24 -0500
  6. Organization: America Online, Inc. (1-800-827-6364)
  7. Sender: root@newsbf02.news.aol.com
  8. Message-ID: <4i19gc$85f@newsbf02.news.aol.com>
  9. References: <3141CB3E.5A36@staff.ichange.com>
  10. Reply-To: jwpirie@aol.com (JWPirie)
  11. NNTP-Posting-Host: newsbf02.mail.aol.com
  12.  
  13. Remember Booch's guidelines:  Inheritance (private or public) should be an
  14. "is a" relationship.  Member objects should be a "part of" relationship.
  15.  
  16. If your base class is Airplane and you want to create a Boeing747 class,
  17. you should probably be inheriting.  If your base class is JetEngine and
  18. you want to create Boeing747, you should probably make JetEngine a member
  19. object.
  20.  
  21. And if access is a problem with the appropriate relationship, you may want
  22. to rethink your base class structure.
  23.  
  24.  
  25. --------------------
  26. John Pirie
  27. Cohane Rafferty Securities, Inc.
  28. Harrison, NY
  29. "I'd keep playing -- I don't think the heavy stuff's comin' down for quite
  30. a while yet."
  31.